package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.hmo.mall.utils.SpUtil;
import xhwl.retrofitrx.BaseApi;


public class MessageListApi extends BaseApi {
    MessageListtReq req;

    public MessageListApi(int page_num) {
        req = new MessageListtReq(page_num);
        setShowDialog(false);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getMessageList(requestBody);
    }

    public class MessageListtReq {
        /**
         * member_id : 3905
         */

        private int page_num;
        private String member_id;

        public MessageListtReq(int page_num) {
            this.member_id = SpUtil.getString(SpUtil.MEMBER_ID, "");
            this.page_num = page_num;
        }
    }
}
